package com.wenx.genericity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wenx on 2019-09-24 19:03
 */
public class FruitTest {
    public static void main(String[] args) {
        List<? super Apple> apples = new ArrayList<Fruit>();
        apples.add(new Apple("青苹果"));
        //apples.add(new Orange("黄橘子"));    //报错

        List<? extends Fruit> fruits = new ArrayList<Apple>();
        //fruits.add(new Apple("苹果"));
    }
}